<template name="admindepartlist">
{{>sAlert}}
	<h1><a href="/admin/depart/add">添加部门</a></h1>
	<table class="table table-responsive">
		<thead>
			<tr>
				<th>
					部门名称
				</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			{{#each departlist}}
				<tr>
					<td>{{departname}}</td>
					<td>{{#if isdelete}}已删除{{else}}正常{{/if}}</td>
					<td>{{#if isdelete}}无{{else}}<a href="#" class="deldepart" data-id="{{_id}}">删除</a>{{/if}}|{{#if isdelete}}无{{else}}<a class="editdepart" href="/admin/depart/edit/{{_id}}" data-id="{{_id}}">编辑</a>{{/if}}</td>
				</tr>
			{{/each}}
		</tbody>
		<tfoot>
			<tr>
				<td colspan="3">{{>pagination}}</td>
			</tr>
		</tfoot>
	</table>

</template>

<template name="admindepartadd">
{{>sAlert}}
<form class="form-horizontal" role="form">
	<div class="form-group">
			<label class="control-label col-sm-2">部门名称</label>
			<div class="form-group">
				<input type="text" name="departname" id="departname" placeholder="请输入部门名称">
			</div>
	</div>
	<div class="form-group">
		<div class="col-sm-10 col-sm-offset-2">
			<button id="adddepart">添加</button>
		</div>
	</div>
</form>

</template>

<template name="admindepartedit">
{{>sAlert}}
<form class="form-horizontal" role="form">
	<div class="form-group">
			<label class="control-label col-sm-2">部门名称</label>
			<div class="form-group">
				<input type="text" name="departname" id="departname" placeholder="请输入部门名称" value="{{departs.departname}}">
			</div>
	</div>
	<div class="form-group">
		<div class="col-sm-10 col-sm-offset-2">
			<button id="adddepart">修改</button>
		</div>
	</div>
</form>

</template>